import java.sql.Connection;
import java.sql.DriverManager;

public class DBPing {
	public static void main(String[] args) throws Exception {

		Connection conn = null;
		String url = "jdbc:mysql://localhost:3310/";
		String dbName = "college";
		String driver = "com.mysql.jdbc.Driver";
		String userName = "";
		String password = "";
		try {
			Class.forName(driver).newInstance();
			conn = DriverManager
					.getConnection(url + dbName, userName, password);
			System.out.println("Connection successfull");
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
		finally{
			try {
				if(conn!=null){
				conn.close();
				}
			} catch (Exception e) {
				
				
			}
		}
		
	}
}
